﻿using TaoSH.AppCode;
using TaoSH.Data;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace TaoSH.View
{

    public partial class DownLoadFile : Page
    {
        public int FileID
        {
            get { return  int.Parse( Request.QueryString["FileID"] ?? "0"); }
        }
        protected void Page_Load(object sender, EventArgs e)
        {

            JH_Auth_FormAttchg attch = new JH_Auth_FormAttchg();
            attch = new JH_Auth_FormAttchgB().GetEntity(d => d.id == FileID);
            Response.ContentType = "application/x-zip-compressed";
            Response.AddHeader("Content-Disposition", "attachment;filename=" + attch.FileOldName);
            string filename = Server.MapPath("../../" + attch.FileUrl);
            Response.TransmitFile(filename);
        }
    }
}